﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WxShare.aspx.cs" Inherits="Yule8xWxToolkit.Other.WxShare" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>微信分享测试</title>
    <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>

</head>
<body>
    <form id="form1" runat="server">
        <div>
        </div>
        <input type="hidden" id="conf" data-appid="<%=appid %>" data-timestamp="<%=timestamp %>" data-noncestr="<%=noncestr %>" data-signature="<%=signature %>" />
    </form>
    <script type="text/javascript">

        var $conf = document.getElementById('conf');
        wx.config({
            debug: true,
            appId: $conf.getAttribute("data-appid"),
            timestamp: $conf.getAttribute("data-timestamp"),
            nonceStr: $conf.getAttribute("data-nonceStr"),
            signature: $conf.getAttribute("data-signature"),
            jsApiList: ['checkJsApi', 'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareAppMessage', 'onMenuShareQQ']
        });
        wx.ready(function () {
            // 发送给朋友
            wx.onMenuShareAppMessage({
                title: '全国有那么多人靠这个赚钱，竟然今天才被曝光',
                desc: '90后逆袭，仅靠300元，努力不到一个月，轻松月入万元',
                link: 'https://wx.34537.com/Agent/Index.aspx',
                imgUrl: 'https://wx.34537.com/Skin/Theme/Images/default.png'
            });
            // 分享到朋友圈
            wx.onMenuShareTimeline({
                title: '全国有那么多人靠这个赚钱，竟然今天才被曝光',
                link: 'https://wx.34537.com/Agent/Index.aspx',
                imgUrl: 'http://wx.34537.com/Skin/Theme/Images/default.png'
            });
        })
        console.log(location.href.split('#')[0]);
    </script>
</body>
</html>
